/**
 * Created by Tiu Fan on 1/27/2015.
 */
var WarningScene = cc.Layer.extend({
    ctor: function () {
        this._super();
        daifugo.warningscene = this;
        this.init();
    },
    init: function () {
        var me = this;
        var size = cc.Director.getInstance().getWinSize();
        me.setTouchEnabled(true);
        me.setTouchMode(cc.TOUCH_ONE_BY_ONE);
        me.imgInfo = cc.Sprite.create(g_imageRes.info);
        me.imgInfo.setPosition(size.width / 2, size.height / 2);
        me.mainsprite = cc.Sprite.create(g_imageRes.s_bg);
        me.mainsprite.setPosition(size.width / 2, size.height / 2);
        me.addChild(this.mainsprite);
        me.btn_okSprite = cc.Sprite.create(g_imageRes.btn_ok);
        me.btn_okSprite.setPosition(size.width / 2, size.height * (170 / 720));
        me.addChild(me.imgInfo);
        me.addChild(me.btn_okSprite);
    },
    onTouchBegan: function(touch){
        var me = this;
        playSound('tap');
        daifugo.serverHandler.contactServer('message', function () {
        }, {action: 'find_table'});
        me.imgInfo.removeFromParent();
        me.btn_okSprite.removeFromParent();
        var nextScene = cc.Scene.create();
        var nextLayer = new PlayScene;
        nextScene.addChild(nextLayer);
        cc.Director.getInstance().replaceScene(nextScene);
    }
});
